Skip to content

Fix rayon code#4

Open
alphastrata wants to merge 6 commits intoMarsRaw:mainfrom
alphastrata:fix-rayon-code
Open

Fix rayon code#4
alphastrata wants to merge 6 commits intoMarsRaw:mainfrom
alphastrata:fix-rayon-code

Conversation

@alphastrata
Copy link
Contributor

@alphastrata alphastrata commented Mar 15, 2025

So I went to use the gaussian with rayon and noticed it was horribly busted.

Whilst I was in there:

  • I opted for the gAussian... spelling, I am pretty sure that's not just an Aussie thing because wikipedia spells it that way too.
  • a safe_get() -> Option<Dn>
  • a helper to get a ref to the ImageBuffers in an Image, which for some reason we didn't already have.
Image::buffers(&self) -> &[ImageBuffer] 
  • I added a benchmark for the st vs the rayon version of gaussian_blur, on my 2013 macbook the results are:
GaussianBlur/single-threaded time: 1.0053 s
GaussianBlur/rayon  time:  303.55 ms 

And on my bigger rig (AMD Ryzen 5950x) its' more like ~380ms for the ST and ~160ms for the Rayon version. [on 100 samples]

To run the benchmarks on your own machine(s) do a cargo bench --features='rayon', there are graphs in the ./target/criterion/* directory that gets created by this bench harness .

I was working on this because I am doing some GPGPU image processing at the moment and prefer to play with space data when playing, but that's another PR for another time.

@alphastrata alphastrata marked this pull request as ready for review March 15, 2025 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant